/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.stop.risk.base.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.stop.common.constant.enums.ParkStopSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.SysDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;

/**
 * 监控点信息
 *
 * @author pig
 * @date 2024-02-20 16:39:33
 */
@Data
@TableName("line_poll_monitor_site")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "监控点信息")
public class LinePollMonitorSiteEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * id
     */
    @Schema(description = "id")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 企业类型 1.企业 2.园区
     */
    @Schema(description = "企业类型 1.企业 2.园区")
    private Integer orgType;

    /**
     * 所属企业
     */
    @Schema(description = "所属企业")
    private Long companyId;

    /**
     * 监控类型
     */
    @Schema(description = "监控类型")
    private Integer monitorType;

    /**
     * 监控点名称
     */
    @Schema(description = "监控点名称")
    private String name;

    /**
     * 监控点编号（MN）
     */
    @Schema(description = "监控点编号（MN）")
    private String code;

    /**
     * 监控级别
     */
    @Schema(description = "监控级别")
    private Integer controlLevel;

    /**
     * 运维类型 1：自运维 2：第三方运维
     */
    @Schema(description = "运维类型 1：自运维 2：第三方运维")
    private Integer operationType;

    /**
     * 运维企业
     */
    @Schema(description = "运维企业")
    private Long operationId;

    /**
     * 排放方式
     */
    @Schema(description = "排放方式")
    private Integer dischargeType;

    /**
     * 排放规律
     */
    @Schema(description = "排放规律")
    private Integer dischargeLaw;

    /**
     * 排放去向
     */
    @Schema(description = "排放去向")
    private String dischargeDirection;

    /**
     * 监控点分类
     */
    @Schema(description = "监控点分类")
    private Integer monitorClassify;

    /**
     * 监控点位置
     */
    @Schema(description = "监控点位置")
    private String monitorLocation;

    /**
     * 启用环保人员报警
     */
    @Schema(description = "启用环保人员报警")
    private String isUseEnvAlarm;

    /**
     * 环保报警人员
     */
    @Schema(description = "环保报警人员")
    private String envAlarmUser;

    /**
     * 启用企业报警
     */
    @Schema(description = "启用企业报警")
    private String isUseCompanyAlarm;

    /**
     * 企业报警人员
     */
    @Schema(description = "企业报警人员")
    private String companyAlarmUser;

    /**
     * 启用运维报警
     */
    @Schema(description = "启用运维报警")
    private String isUseOperationAlarm;

    /**
     * 运维报警人员
     */
    @Schema(description = "运维报警人员")
    private String operationAlarmUser;

    /**
     * 联网时间
     */
    @Schema(description = "联网时间")
    private LocalDate networkTime;

    /**
     * 联网状态
     */
    @Schema(description = "联网状态")
    private Integer networkStaus;

    /**
     * 经度
     */
    @Schema(description = "经度")
    private String longitude;

    /**
     * 维度
     */
    @Schema(description = "维度")
    private String latitude;

    /**
     * 高度
     */
    @Schema(description = "高度")
    private String altitude;

    /**
     * 是否使用
     */
    @Schema(description = "是否使用")
    private Boolean isUse;

    /**
     * 传输协议
     */
    @Schema(description = "传输协议")
    private String protocolType;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remarks;

    /**
     * 监测因子名
     */
    @Schema(description = "监测因子名")
    private String monitorFactorNames;

    /**
     * 自动监控设备数量
     */
    @Schema(description = "自动监控设备数量")
    private Integer autoMoniorNum;

    /**
     * 是否有报警 1.是 0.否
     */
    @Schema(description = "是否有报警 1.是 0.否")
    private String isAlarm;

    /**
     * 是否有数据异常 1.是 0.否
     */
    @Schema(description = "是否有数据异常 1.是 0.否")
    private String isDataError;

    /**
     * 是否断网 1.是 0.否
     */
    @Schema(description = "是否断网 1.是 0.否")
    private String isBrokenNet;

    /**
     * 监控点状态 1. 运行中 2. 设备故障
     */
    @Schema(description = "监控点状态 1. 运行中 2. 设备故障")
    private Integer siteStatus;

    /**
     * 状态描述
     */
    @Schema(description = "状态描述")
    private String siteStatusDesc;

    /**
     * 监控点图片
     */
    @Schema(description = "监控点图片")
    private String imgFile;

    /**
     * 监控点视频
     */
    @Schema(description = "监控点视频")
    private String videoId;

    /**
     * 分钟数据传输间隔
     */
    @Schema(description = "分钟数据传输间隔")
    private Integer minDataInterval;

    /**
     * 是否发送数据缺失短信
     */
    @Schema(description = "是否发送数据缺失短信")
    private String isSmsDataMissing;

    /**
     * 分钟数据重复几次报警
     */
    @Schema(description = "分钟数据重复几次报警")
    private Integer alarmMinSameTimes;


    private Long orgId;


    public String getIsUseStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.isUse);
    }

    public String getMonitorTypeStr() {
        return DictResolver.getItemLabelByValue(ParkStopSysDictEnum.monitor_type, this.monitorType);
    }


}
